<h:form id="formUnidadeGestora" 
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://java.sun.com/jsf/core">

    <script language="JavaScript" src = "scripts/script.js"/>

    <h:panelGrid columns="2">

        <h:panelGroup >
            <h:outputLabel value="Código"/><br/>
            <p:inputMask value="#{unidadeGestoraBean.unidadeGestora.codigo}" 
                         required="true" requiredMessage="Campo Obrigatório" 
                         maxlength="2" mask="99"/>
        </h:panelGroup>

    </h:panelGrid>

    <h:panelGrid style="width: 100%">

        <h:panelGroup>
            <h:outputLabel value="Descrição"/><br/>
            <p:inputText styleClass="up" value="#{unidadeGestoraBean.unidadeGestora.descricao}" 
                         required="true" requiredMessage="Campo Obrigatoacute;rio" 
                         maxlength="80" style="width: 97%"/>
        </h:panelGroup>

    </h:panelGrid>

    <h:panelGrid style="width: 100%" columns="3">

        <h:panelGroup>
            <h:outputLabel value="Data Incl.[Unid. Orçam.]"/><br/>
            <p:calendar maxlength="10" 
                        pattern="dd/MM/yyyy"
                        onkeypress="mascara(this, data)"
                        value="#{unidadeGestoraBean.unidadeGestora.dataIncUnidOrc}"
                        showOn="button" 
                        required="true" 
                        requiredMessage="Campo Obrigatoacute;rio"/>
        </h:panelGroup>

        <h:panelGroup>
            <h:outputLabel value="Data Incl.[Unid. Gest.]"/><br/>
            <p:calendar maxlength="10" 
                        pattern="dd/MM/yyyy"
                        onkeypress="mascara(this, data)"
                        value="#{unidadeGestoraBean.unidadeGestora.dataIncUnidGes}"
                        showOn="button" 
                        required="true" 
                        requiredMessage="Campo Obrigatoacute;rio"/>
        </h:panelGroup>

        <h:panelGroup>
            <h:outputLabel value="Tipo"/><br/>
            <p:selectOneMenu value="#{unidadeGestoraBean.unidadeGestora.tipoOrgao}" 
                             style="width: 135px" required="true" requiredMessage="Campo Obrigatoacute;rio">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{unidadeGestoraBean.tiposOrgao}"/>
                <f:converter converterId="simpleEntityConverter"/>
            </p:selectOneMenu>
        </h:panelGroup>
    </h:panelGrid>

    <h:panelGrid columns="1" style="width: 100%">
        <h:panelGroup>
            <h:outputLabel value="Lei GES"/><br/>
            <p:inputText styleClass="up" value="#{unidadeGestoraBean.unidadeGestora.leiGes}" 
                         required="true" requiredMessage="Campo Obrigatoacute;rio" 
                         maxlength="10" style="width: 97%"/>
        </h:panelGroup>
    </h:panelGrid>

    <hr/>

    <p:commandButton id="btnGravar" value="Gravar" 
                     actionListener="#{unidadeGestoraBean.adicionarEditarFim}"
                     update="formUnidadeGestora" />

    <p:commandButton value="Cancelar" 
                     actionListener="#{unidadeGestoraBean.cancelar}"
                     immediate="true"/>

</h:form>


